import { requestClient } from '#/api/request';

export namespace Batch {
  export interface Params {
    attr1: null;
  }
  export interface Row {
    searchValue: null;
    createBy: string;
    createTime: null;
    updateBy: string;
    updateTime: null;
    remark: string;
    params: Params;
    batchId: number;
    batchCode: string;
    itemId: number;
    itemCode: string;
    itemName: string;
    specification: string;
    unitOfMeasure: string;
    unitName: null;
    produceDate: null;
    expireDate: Date;
    recptDate: null;
    vendorId: number;
    vendorCode: string;
    vendorName: null;
    vendorNick: null;
    clientId: null;
    clientCode: null;
    clientName: null;
    clientNick: null;
    coCode: null;
    poCode: string;
    workorderId: null;
    workorderCode: null;
    taskId: null;
    taskCode: null;
    workstationId: null;
    workstationCode: null;
    toolId: null;
    toolCode: null;
    moldId: null;
    moldCode: null;
    lotNumber: null;
    qualityStatus: null;
    attr2: null;
    attr3: number;
    attr4: number;
    attr1: boolean | null | string;
  }
  export interface GetListParams {
    pageNum: number;
    pageSize: number;
    vendorId: string;
  }
  export interface GetListReturn {
    total: number;
    rows: Row[];
    code: number;
    msg: string;
  }
}

// 获取列表
export const getBatchTableList = (params: Batch.GetListParams) =>
  requestClient.get<Batch.GetListReturn>('/mes/wm/batch/list', {
    params,
  });
